package au.com.betaversion.domain;

import java.util.Set;

import org.neo4j.graphdb.Direction;
import org.springframework.data.neo4j.annotation.Fetch;
import org.springframework.data.neo4j.annotation.GraphId;
import org.springframework.data.neo4j.annotation.Indexed;
import org.springframework.data.neo4j.annotation.NodeEntity;
import org.springframework.data.neo4j.annotation.RelatedToVia;

@NodeEntity
public class Movie {
	
	@GraphId 
	private Long nodeId;
	
	@Indexed
	private String id;
	
	private String title;
	private int year;
	
	@Fetch
	@RelatedToVia(type ="ACTS_IN", direction = Direction.INCOMING)
	private Set<Role> cast;
	
	public Movie() {
		// TODO Auto-generated constructor stub
	}

	public Movie(String title, int year) {
		super();
		this.title = title;
		this.year = year;
	}
	
	public Movie(String id, String title, int year) {
		super();
		this.id = id;
		this.title = title;
		this.year = year;
	}

	public Long getNodeId() {
		return nodeId;
	}

	public void setNodeId(Long nodeId) {
		this.nodeId = nodeId;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public int getYear() {
		return year;
	}

	public void setYear(int year) {
		this.year = year;
	}

	public Set<Role> getCast() {
		return cast;
	}

	public void setCast(Set<Role> cast) {
		this.cast = cast;
	}
}
